|
|
|
|
|
|
|
Many computer programs are interactive; that is, they perform functions in response to user actions. In Chapter 5, "Responding to the User with Event Procedures," you learned how to make the objects in your program react to user actions. In this chapter, you explore how to give more control to your users. You learn how to add menu structures to your programs, giving your users the capability to select from a number of program commands. You will then see how to add toolbars to give your users a shortcut to commonly-used program functions. |
|
|
|
|
|
|
|
|
One of the most important aspects in designing any program is providing the users with easy access to all the program's functions. Users are accustomed to accessing most functions with a mouse click or two. In addition, they want all the functions located conveniently in one place. To help facilitate this strategy, Visual Basic lets you quickly and easily create a menu system with the Menu Editor. You can use this editor to create a menu bar for each of your application's forms, as well as context-sensitive "pop-up" menus (see the section "Creating Pop-Up Menus" later in this chapter). |
|
|
|
|
|
|
|
|
The menu bar for the main form of a custom-designed exposition management program is shown in Figure 6.1. |
|
|
|
|
|
|
|
|
Figure 6.1
A well-designed menu system enables a program's
users to locate and execute its functions easily. |
|
|
|
|
|
|
|
|
The first step in creating a menu is determining what program commands need to be on the menu and how these commands should be organized. Figure 6.2 shows Visual Basic's own main menu. As you can see, the commands are organized into functional groups (File, Edit, View, and so forth). |
|
|
|
|
|
|
|
|
Figure 6.2
Visual Basic's main menu, shown here with its File menu opened, provides a
convenient and intuitive way for users to select the various program functions. |
|
|
|
|
|